php forum
php mysql forum
php mysql smarty
 
Topic Options
#317011 - 05/19/08 07:38 AM [7.3] Salvage >- Recover losts posts
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
If this query:

Code:
SELECT count( DISTINCT TOPIC_ID )
FROM ubbt_POSTS
WHERE TOPIC_ID NOT
IN (
SELECT TOPIC_ID
FROM ubbt_TOPICS
)


Gives you a result >0 you have posts in your database that are not referenced anymore by any existing topic. Attached scripts will salvage those topics to a predefined forum (YOU HAVE TO SET THIS MANUALLY IN THE SCRIPT BEFORE USING IT).

This script and above query require MySQL >= v4.10

Enjoy your cleaned up database smile


Attachments
salvage.zip (12 downloads)
Description: Topic salvage tool v1.00


_________________________

Top
#317012 - 05/19/08 07:44 AM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
A note that didn't really fit in the first post of this topic. The inline moderation does not always want to cooperate with topics salvaged by above tool. Not all salvaged topics are a-okay. Some topics you have to delete by going into them and deleting them with the manage topic stuff.

When using the tool, I discovered some complete topics, but also some loose messages.
_________________________

Top
#317013 - 05/19/08 08:17 AM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Thanks - gave it a go as I had 19 posts that were not linked.

It recovered 5 threads. Not all can now be deleted, which I am not too worried about.

One says it can't find the post in the database to view the post.

The other where it merged two threads together (making a 4 post thread), I could delete the last 2 posts, but the 2nd post you can't delete as it says it is the first post in the thread (which it isn't now) and has dependant posts beneath it (which it doesn't)

Anyway I am not too worried, but just reporting back my findings.

HOWEVER! - it found the very first post I made with threads back in 2001 - meaning that my forums are at least 7 years old. Although they go back a couple of years further in a smaller incarnation. So I am happy smile
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#317014 - 05/19/08 08:27 AM Re: [7.3] Salvage >- Recover losts posts [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
For some posts, I just went into the post, and deleted it from the edit post screen.

I also had one problem with a post I could not click on, but clicking on the date on the left did open the topic.

You finding your very first post kinda makes the time spend on this all worth it wink
_________________________

Top
#317018 - 05/19/08 11:19 AM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ
Quote:

$salvageforum = #;


Just to be clear, would I have to run this for each forum? Can the new private forum be used for each run of this?

Edit: Never mind, I read that wrong...


Edited by jgeoff (05/19/08 11:20 AM)
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#317019 - 05/19/08 11:21 AM Re: [7.3] Salvage >- Recover losts posts [Re: jgeoff]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
No, the forum you enter there is the forum the lost posts are put into.

You should make a new empty forum for that to see exactly what is salvaged.
_________________________

Top
#317020 - 05/19/08 11:32 AM Re: [7.3] Salvage >- Recover losts posts [Re: jgeoff]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

It worked... YOU RULE!!! cool

Now to figure out how long thread posts get orphaned to begin with...

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#317021 - 05/19/08 11:41 AM Re: [7.3] Salvage >- Recover losts posts [Re: jgeoff]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Great to hear!
_________________________

Top
#317023 - 05/19/08 11:57 AM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
sometimes Yarp™ does good work... laugh

it's akin to a Blind squirrel getting an acorn every now and then..

</joke mode>
_________________________

Top
#317029 - 05/20/08 11:03 PM Re: [7.3] Salvage >- Recover losts posts [Re: sirdude]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Cool, my personal site lists 2, I need to try and and run the script now.

I know we could probably use it here - seems like most of the announcements we imported from threadsdev have issues - like ubbt_topics has them, but ubbt_posts doesn't. Except our mysl is 4.0.something smash
_________________________
- Allen wavey
- What Drives You?

Top
#317031 - 05/21/08 02:10 AM Re: [7.3] Salvage >- Recover losts posts [Re: AllenAyres]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Ah, is ubbdev the reason threads still insists on supporting MySQL <4.1 wink

You would only need to redo the part that finds out about the lost posts and their topic id's since that one uses a query in a query. The rest would work fine.
_________________________

Top
#317039 - 05/21/08 10:52 AM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
You may be right there wink

I may talk to Navaho and see about transferring the site to our server... he'd probably prefer to get it out of his hair too smile
_________________________
- Allen wavey
- What Drives You?

Top
#317074 - 05/26/08 01:32 PM Re: [7.3] Salvage >- Recover losts posts [Re: AllenAyres]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
you guys should be on mysql 5 and php 5 and apache 2, for being a ubbDEV site, imho :2c:

i have a dedicated server that can handle your needs wink
_________________________

Top
#317098 - 05/29/08 10:02 PM Re: [7.3] Salvage >- Recover losts posts [Re: sirdude]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
We should... I have lots of space on mine too - I may ask him soon.
_________________________
- Allen wavey
- What Drives You?

Top
#318650 - 10/22/10 12:29 PM Re: [7.3] Salvage >- Recover losts posts [Re: blaaskaak]
Jake 2 Offline
Lurker

Registered: 10/22/10
Posts: 1
The script worked perfectly. Many thanks!

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks